//  RemindNewsAlert.m
//  XJMCustomer
//  Created by Mr.hu on 2017/10/10.
//  Copyright © 2017年 Mr.hu. All rights reserved.

#import "RemindNewsAlert.h"

@implementation RemindNewsAlert

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self == [super initWithFrame:frame]) {
        
        CGFloat tenfloat = 10;
        CGFloat widthcancelbind = ScreenWidth-80;
        CGFloat heightcancelbind = (ScreenWidth-80)*4/5;
        
        UIView * subview = [[UIView alloc]initWithFrame:CGRectMake(40, (ScreenHeight - heightcancelbind)*2/5, widthcancelbind, heightcancelbind)];
        subview.backgroundColor = [UIColor whiteColor];
        subview.layer.cornerRadius = 15;
        subview.userInteractionEnabled = YES;
        [self addSubview:subview];
        
        self.bingdcancelbtn =[[UIButton alloc]init];
        [self.bingdcancelbtn setImage:[UIImage imageNamed:@"iconguanbi"] forState:UIControlStateNormal];
        [subview addSubview:self.bingdcancelbtn];
        [self.bingdcancelbtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(10);
            make.left.mas_offset(20);
            make.size.mas_equalTo(CGSizeMake(20, 20));  //170 65
        }];
        
        _leftToplab = [[UILabel alloc]init];
        _leftToplab.text = @"全程69折起,下单即享";
        _leftToplab.textColor = [UIColor blackColor];
        _leftToplab.font = [UIFont systemFontOfSize:15];
        _leftToplab.textAlignment = NSTextAlignmentCenter;
        [subview addSubview:_leftToplab];
        [_leftToplab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(10);
            make.centerX.mas_equalTo(0);
            make.size.mas_equalTo(CGSizeMake(widthcancelbind,20));
        }];
        
        UIView * defaultSubView = [[UIView alloc]initWithFrame:CGRectMake(0, 40, widthcancelbind, 1)];
        defaultSubView.backgroundColor = RGBA(213, 32, 30, 1);
        [subview addSubview:defaultSubView];
        
        self.reminddetaillab = [[UILabel alloc]init];
        self.reminddetaillab.text = @"您未绑定任何行程,请先绑定行程,再来选择出行线路。";
        self.reminddetaillab.textColor = RGBA(37, 37, 37, 1);
        self.reminddetaillab.numberOfLines = 0;
        self.reminddetaillab.font = [UIFont systemFontOfSize:15];
        self.reminddetaillab.textAlignment = NSTextAlignmentLeft;
        [subview addSubview:self.reminddetaillab];
        [self.reminddetaillab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(defaultSubView.mas_bottom).offset(0);
            make.left.mas_equalTo(tenfloat*3);
            make.size.mas_equalTo(CGSizeMake(widthcancelbind-tenfloat*6, 60));
        }];
        
        self.bindingexitbtn =[[UIButton alloc]init];
        [self.bindingexitbtn setTitle:@"下一条" forState:UIControlStateNormal];
        self.bindingexitbtn.titleLabel.font = [UIFont systemFontOfSize:16];
        self.bindingexitbtn.layer.cornerRadius = 15;
        self.bindingexitbtn.layer.masksToBounds = YES;
        [self.bindingexitbtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self.bindingexitbtn setBackgroundColor:RGBA(213, 32, 30, 1)];
        [subview addSubview:self.bindingexitbtn];
        [self.bindingexitbtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(-tenfloat*2);
            make.centerX.mas_equalTo(0);
            make.size.mas_equalTo(CGSizeMake(widthcancelbind*3/7, widthcancelbind*3/7*65/170));
        }];
        
        //        [self.bingdcancelbtn addTarget:self action:@selector(cancelbindingOnclicked) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return self;
}

@end
